Median

Mathematical Foundation

The median is a robust measure of central tendency that represents the middle value in an ordered dataset. Unlike the mean, which uses all data values, the median depends only on the position of values in the ordered list. This makes it highly resistant to extreme values (outliers) and provides a better representation of the "typical" value when data contains anomalies or skewed distributions.

Median Calculation:
  • Odd number of data points (n odd): Median = value at position $\frac{n+1}{2}$
  • Even number of data points (n even): Median = average of values at positions $\frac{n}{2}$ and $\frac{n}{2} + 1$
  • Formula: $Median = \begin{cases} x_{\frac{n+1}{2}} & \text{if } n \text{ is odd} \\ \frac{x_{\frac{n}{2}} + x_{\frac{n}{2}+1}}{2} & \text{if } n \text{ is even} \end{cases}$
Where:
  • $n$ = number of data points
  • $x_k$ = k-th value in ordered data

Interactive Median Calculator

Data Visualization

6.5
Median
41
Median position
6
Data Points

Worked Example 1: Odd Number of Values

Find the median of: 12, 7, 15, 9, 21

Solution:

Step 1: Sort the data: 7, 9, 12, 15, 21

Step 2: n = 5 (odd), so median position = (5+1)/2 = 3rd value

Step 3: Median = 12

Worked Example 2: Even Number of Values

Find the median of: 8, 12, 15, 7, 10, 22

Solution:

Step 1: Sort the data: 7, 8, 10, 12, 15, 22

Step 2: n = 6 (even), so median positions = 3rd and 4th values

Step 3: Median = (10 + 12) / 2 = 11

Worked Example 3: Median with Outliers

Compare mean and median for: 2, 4, 6, 8, 100

Solution:

Sorted: 2, 4, 6, 8, 100

Median = 6 (middle value)

Mean = (2+4+6+8+100)/5 = 120/5 = 24

The outlier (100) greatly affects the mean but not the median.

Properties of the Median
Median vs Mean: When to Use Each

Use Median When:

  • Data contains outliers or extreme values
  • Distribution is skewed
  • Data is ordinal (rank-based)
  • Robustness is important
  • Income, property values, test scores with anomalies

Use Mean When:

  • All data points are equally important
  • Mathematical calculations are needed
  • Data is normally distributed
  • Precision is more important than robustness
  • Physical measurements, balanced data

Practice Problems

Problem 1: Find the median of: 15, 8, 12, 6, 19, 23, 10
Solution:
Sorted: 6, 8, 10, 12, 15, 19, 23
n = 7 (odd), median position = (7+1)/2 = 4th value
Median = 12
Problem 2: Find the median of: 4, 7, 2, 9, 5, 8
Solution:
Sorted: 2, 4, 5, 7, 8, 9
n = 6 (even), median positions = 3rd and 4th values
Median = (5 + 7) / 2 = 6
Problem 3: The median of 9 numbers is 25. What can you say about the numbers?
Solution:
For 9 numbers (odd), median is the 5th value when sorted
At least 5 numbers ≤ 25, and at least 5 numbers ≥ 25
At least 4 numbers ≤ 25, and at least 4 numbers ≥ 25
Problem 4: Find the median of: 1, 3, 3, 3, 5, 7, 9
Solution:
Sorted: 1, 3, 3, 3, 5, 7, 9
n = 7 (odd), median position = 4th value
Median = 3
Problem 5: Compare the mean and median of: 1, 2, 3, 4, 100
Solution:
Sorted: 1, 2, 3, 4, 100
Median = 3
Mean = (1+2+3+4+100)/5 = 110/5 = 22
The outlier (100) increases the mean but doesn't affect the median.

Key Takeaways